
class Stu :
     #固有属性（类属性，所有实体共用
    id_List = []
    def __init__(self, name, age, gender, sid = 0):

        self.name=name
        self.age=age
        self.gender=gender
        if sid == 0 :
            if len(Stu.id_List) == 0:
                self.sid = 1
                Stu.id_List.append(1)
            else:
                for i in range(1,100):
                    flag = 0
                    for j in Stu.id_List:
                        if i == int(j):
                            flag = 1
                    if flag == 0:
                        self.sid = i
                        Stu.id_List.append(i)
                        break
        else:
            self.sid = sid
            Stu.id_List.append(sid)






